Skip to content

Comments

fromBinaryToDecimal#39

Open
Andrw-404 wants to merge 1 commit intomainfrom
thirdTest(firstTask)
Open

fromBinaryToDecimal#39
Andrw-404 wants to merge 1 commit intomainfrom
thirdTest(firstTask)

Conversation

@Andrw-404
Copy link
Owner

No description provided.

int decimal = 0;
int length = strlen(binaryString);
for (int i = 0; i < length; ++i) {
decimal = decimal * 2;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
decimal = decimal * 2;
decimal *= 2;

Это то же самое, только короче

Comment on lines +33 to +36
if (firstTestDecimal != 27 || secondTestDecimal != 14 || thirdTestDecimal != 223) {
return false;
}
return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (firstTestDecimal != 27 || secondTestDecimal != 14 || thirdTestDecimal != 223) {
return false;
}
return true;
return firstTestDecimal == 27 && secondTestDecimal == 14 && thirdTestDecimal == 223;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants